
<%@ page import="greendbgui.ElectoralRollEntry" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'electoralRollEntry.label', default: 'ElectoralRollEntry')}" />
        <tooltip:resources/>
		<title><g:message code="default.list.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#list-electoralRollEntry" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
			<ul>
				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
<!--				<li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
-->
			</ul>
		</div>
		<div id="list-electoralRollEntry" class="content scaffold-list" role="main">
			<h1><g:message code="default.list.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<g:form action="search">
			   <g:hiddenField name="id" value="${params.id}"/>
			   
			   <dt>Name:</dt>
			   <dd><g:textField name="name"/></dd>

			   <dt>Address:</dt>
			   <dd><g:textField name="address"/></dd>

			   <dt><g:actionSubmit value="Search"/></dt>
			</g:form>
			<table>
				<thead>
					<tr>
					
			            <th><g:message code="electoralRollEntry.ref.label" default="Reference" /></th>
            
                        <th><g:message code="electoralRollEntry.person.label" default="Person" /></th>

                        <th><g:message code="electoralRollEntry.address.label" default="Address" /></th>
            							
                        <th><g:message code="electoralRollEntry.voteType.label" default="Vote Type" /></th>
                        
<!--						<g:sortableColumn property="voteType" title="${message(code: 'electoralRollEntry.voteType.label', default: 'Vote Type')}" />
-->					
					</tr>
				</thead>
				<tbody>
				<g:each in="${electoralRollEntryInstanceList}" status="i" var="electoralRollEntryInstance">
					<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
					
                        <td>${fieldValue(bean: electoralRollEntryInstance, field: "ref")}</td>
                    
                        <td>
                       <g:link controller="person" action="display" params="[id:electoralRollEntryInstance.person.id, entryId:electoralRollEntryInstance.id]">
                            ${fieldValue(bean: electoralRollEntryInstance, field: "person")}
                       </g:link>
                        </td>
                    
                            <td>
                            <tooltip:tip code="${electoralRollEntryInstance.address.singleLine}">
                                ${fieldValue(bean: electoralRollEntryInstance, field: "address.address1")}
                            </tooltip:tip>
                            </td>
                        
						<td>${fieldValue(bean: electoralRollEntryInstance, field: "voteType")}</td>
					
					</tr>
				</g:each>
				</tbody>
			</table>
			<div class="pagination">
				<g:paginate id="${params.id}" 
				            total="${electoralRollEntryInstanceTotal}" 
				            params="[name:params?.name, address:params?.address]" />
			</div>
		</div>
	</body>
</html>
